- /* lastchar.cpp by K. Tsuru*/
- #include <string.h>
- /***************************
- It returns the ponter of last character of the string "s".
- ****************************/
- char* LastChar(const char* s){
- char* p;
- if(*s == '\0') return NULL; //empty
- p = strchr(s, 0); //"p" points last '\0' of "s".
- return (p-1);
- }